﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="application-list.aspx.cs"
    Inherits="SsWeb._console.core.application_list" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <a href="role-list.aspx">
            角色列表
        </a>
        <a href="user-list.aspx">
            用户列表
        </a>
    </div>
    <div>
        <label>
            名称</label>
        <asp:TextBox ID="_ctlEditText" runat="server" />
        <br />
        <label>
            图标</label>
        <asp:FileUpload ID="_ctlFileImage" runat="server" />
        <br />
        <label>
            主题</label>
        <asp:DropDownList ID="_ctlListTheme" runat="server" DataTextField="Caption" DataValueField="Id" />
        <a href="theme-list.aspx" target="_blank">查看主题</a>
        <br />
        <asp:Button ID="_ctlBtnSave" Text="保存" runat="server" OnClick="_ctlBtnSave_Click" />
    </div>
    <div>
        <asp:Repeater ID="_ctlList" runat="server" DataMember="Id" OnItemCommand="_ctlList_ItemCommand">
            <HeaderTemplate>
                <table style="width: 100%;" border="1">
                    <tr>
                        <th style="width: 50px;">
                            -
                        </th>
                        <th>
                            名称
                        </th>
                        <th>
                            默认应用
                        </th>
                        <th>
                            排序号
                        </th>
                        <th>
                            主题
                        </th>
                        <th>
                            导航
                        </th>
                    </tr>
            </HeaderTemplate>
            <ItemTemplate>
                <tr>
                    <td>
                        <span id="_ctlLabel" runat="server" visible='<%# IsSelected(Eval("Id")) %>'>已选择</span>
                        <a id="_ctlLink" href='<%# Eval("Id","?id={0}") %>' runat="server" visible='<%# !IsSelected(Eval("Id")) %>'>
                            选择</a>
                    </td>
                    <td>
                        <%# Eval("Name") %>
                    </td>
                    <td>
                        <asp:LinkButton ID="_ctlBtnEnable" Text="设置默认" runat="server" CommandName="enable"
                            CommandArgument='<%# Eval("Id") %>' Visible='<%# !((bool)Eval("IsDefault")) %>' />
                        <asp:LinkButton ID="_ctlBtnDisable" Text="取消默认" runat="server" CommandName="disable"
                            CommandArgument='<%# Eval("Id") %>' Visible='<%# Eval("IsDefault") %>' />
                    </td>
                    <td>
                        <%# Eval("SortIndex") %>
                    </td>
                    <td>
                        <a title="<%# Eval("ThemeId") %>">
                            <%# GetThemeName(Eval("ThemeId"))%>
                        </a>
                    </td>
                    <td>
                        <a href='./navigation-list.aspx?id=<%# Eval("Id") %>' target="_blank">设置导航</a>
                    </td>
                </tr>
            </ItemTemplate>
            <FooterTemplate>
                </table>
            </FooterTemplate>
        </asp:Repeater>
    </div>
    <asp:Panel ID="_ctlPanelDetail" runat="server">
        <div>
            <b>1.选择主题</b>
            <asp:Repeater ID="_ctlGridTheme" runat="server" DataMember="Id" OnItemCommand="_ctlGridTheme_ItemCommand">
                <HeaderTemplate>
                    <table style="width: 100%;" border="1">
                        <tr>
                            <th style="width: 50px;">
                                -
                            </th>
                            <th>
                                名称
                            </th>
                        </tr>
                </HeaderTemplate>
                <ItemTemplate>
                    <tr>
                        <td>
                            <asp:LinkButton ID="_ctlBtnDisable" Text="设置" runat="server" CommandName="enable"
                                CommandArgument='<%# Eval("Id") %>' Visible='<%# !IsCurrentTheme(Eval("Id")) %>' />
                        </td>
                        <td>
                            <%# Eval("Caption") %>
                        </td>
                    </tr>
                </ItemTemplate>
                <FooterTemplate>
                    </table>
                </FooterTemplate>
            </asp:Repeater>
        </div>
        <div>
            <b>2.选择模块</b><a href="module-list.aspx">管理模块</a>
            <asp:Repeater ID="_ctlGridModule" runat="server" DataMember="Id" OnItemCommand="_ctlGridModule_ItemCommand">
                <HeaderTemplate>
                    <table style="width: 100%;" border="1">
                        <tr>
                            <th style="width: 50px;">
                                -
                            </th>
                            <th>
                                名称
                            </th>
                        </tr>
                </HeaderTemplate>
                <ItemTemplate>
                    <tr>
                        <td>
                            <asp:LinkButton ID="_ctlBtnSetModules" Text="启用" runat="server" CommandName="enable"
                                CommandArgument='<%# Eval("Id") %>' Visible='<%# !IsContains(Eval("Id")) %>' />
                            <asp:LinkButton ID="_ctlBtnRemoveModules" Text="禁用" runat="server" CommandName="disable"
                                CommandArgument='<%# Eval("Id") %>' Visible='<%# IsContains(Eval("Id")) %>' />
                        </td>
                        <td>
                            <%# Eval("Caption") %>
                        </td>
                    </tr>
                </ItemTemplate>
                <FooterTemplate>
                    </table>
                </FooterTemplate>
            </asp:Repeater>
        </div>
        <div>
            <b>分配导航</b>
            <div>
                <label>角色</label>
                <asp:DropDownList ID="_ctlListRole" runat="server" AutoPostBack="True" DataTextField="Caption" DataValueField="Id" 
                    onselectedindexchanged="_ctlListRole_SelectedIndexChanged">
                </asp:DropDownList>
                <asp:Button ID="_ctlBtnSetNavigation" runat="server" Text="分配导航" 
                    onclick="_ctlBtnSetNavigation_Click" />
            </div>
            <asp:TreeView ID="_ctlTreeNavigation" runat="server" Width="100%" 
                ShowCheckBoxes="All">
            </asp:TreeView>
        </div>
    </asp:Panel>
    </form>
</body>
</html>
